package Application.UIEditApplication.manager
{
	import Application.UIEditApplication.def.Def;
	import Application.UIEditApplication.def.Manager;
	import Application.UIEditApplication.view.scene.UIEditScene;
	import Application.UIEditApplication.view.ui.ComponentInfoMed;
	import Application.UIEditApplication.view.ui.ComponentListMed;
	import Application.UIEditApplication.view.ui.EditUIMed;
	
	import def.XG;

	public class SceneManager
	{
		public var group : Object;
		
		public static const SceneId_PreLoading : int = 	0;
		public static const SceneId_UIEdit  : int = 		1;
		
		private var m_lastScene : *;
		
		public function SceneManager()
		{
			
		}
		
		public function IntoScene(sceneId : int) : void
		{
			switch(sceneId)
			{
				case SceneId_PreLoading:
					intoPreLoadingScene();
					break;
				case SceneId_UIEdit:
					intoUIEditScene();
					break;
			}
		}
		
		/**预加载场景**/
		private function intoPreLoadingScene():void
		{
			Manager.Stage.init();
		}
		
		/***资源加载回调*/
		private function loadSourceCallBack() : void
		{	

		}
		
		private function intoUIEditScene() : void
		{	
			XG.openUI(ComponentListMed.NAME,ComponentListMed);
			XG.openUI(EditUIMed.NAME,EditUIMed);
//			XG.openUI(ComponentInfoMed.NAME,ComponentInfoMed);
			
			clear();
			
			m_lastScene = new UIEditScene;
		}
		
		private function clear() : void
		{
			if(m_lastScene)
			{
				m_lastScene.destory();
			}
		}
	}
}